import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "@/views/HomeView.vue";
import About from "@/views/About.vue";

//配置信息中需要页面相关配置

const routes = [
    {
        path:"/",
        component:HomeView
    },
    {
        path:"/about",
        component:About
    }
]

const router = createRouter({
    /*createWebHashHistory

    home:http://localhost:8080/#/
    about:http://localhost:8080/#/about
    原理：a标签锚点连接

    */

    /*createWebHistory

    Home:http://localhost:8080/
    About:http://localhost:8080/about
    
    此种方式，需要后台配合做重定向，否则会出现404问题
    原理：H5 pushState()

    */
    history:createWebHashHistory(),
    routes
})

export default router;